<html>
<head>
	<title>方问父子节点</title>
</head>
<body>
<script>
	var oHTML = document.documentElement ;
	//	alert(oHTML.nodeName) ;
	//	alert(oHTML.tagName) ;
	//	var oHead = oHTML.firstChild ;
	//	alert(oHead.nodeName) ;
	//	var oBody = oHTML.lastChild ;
	//	alert(oBody.nodeName) ;
	//	var oHead = oHTML.childNodes[0] ;
	//	alert(oHead.nodeName) ;
	//	var oBody = oHTML.childNodes[1] ;
	//	alert(oBody.nodeName) ;
	var oBody = document.body ;
	var oHtml = oBody.parentNode ;
	var oHead = oBody.previousSibling ;
	alert(oHtml.nodeName) ;
	alert(oHead.nodeName) ;

</script>
</body>
</html>